﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas0a01
    {
		private string _groupcode;
		private string _groupname;
		private string _valuecode;
		private string _valuename;
		private string _remark;
		private string _listid;
		private string _value1;
		private string _value2;
		
        /// <summary>
        /// 组别编码
        /// </summary>
		public string Groupcode
		{
			get { return _groupcode;	 }
			set { _groupcode=value;	}
		}
        /// <summary>
        /// 组别名称
        /// </summary>
		public string Groupname
		{
			get { return _groupname;	 }
			set { _groupname=value;	}
		}
        /// <summary>
        /// 小组代码
        /// </summary>
		public string Valuecode
		{
			get { return _valuecode;	 }
			set { _valuecode=value;	}
		}
        /// <summary>
        /// 小组名称
        /// </summary>
		public string Valuename
		{
			get { return _valuename;	 }
			set { _valuename=value;	}
		}
        /// <summary>
        /// 简要说明
        /// </summary>
		public string Remark
		{
			get { return _remark;	 }
			set { _remark=value;	}
		}
        /// <summary>
        /// 主键编码
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Value1
		{
			get { return _value1;	 }
			set { _value1=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Value2
		{
			get { return _value2;	 }
			set { _value2=value;	}
		}
		
		public static List<Bas0a01> GetBas0a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas0a01> list = new List<Bas0a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas0a01 model = GetBas0a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas0a01 GetBas0a01ByDataRow(DataRow dr)
		{
			Bas0a01 model = new Bas0a01(); //实例化Bas0a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("groupcode")&&!(dr["groupcode"] is System.DBNull))  
				model.Groupcode = ( string)dr["groupcode"];
			if (dcc.Contains("groupname")&&!(dr["groupname"] is System.DBNull))  
				model.Groupname = ( string)dr["groupname"];
			if (dcc.Contains("valuecode")&&!(dr["valuecode"] is System.DBNull))  
				model.Valuecode = ( string)dr["valuecode"];
			if (dcc.Contains("valuename")&&!(dr["valuename"] is System.DBNull))  
				model.Valuename = ( string)dr["valuename"];
			if (dcc.Contains("remark")&&!(dr["remark"] is System.DBNull))  
				model.Remark = ( string)dr["remark"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("value1")&&!(dr["value1"] is System.DBNull))  
				model.Value1 = ( string)dr["value1"];
			if (dcc.Contains("value2")&&!(dr["value2"] is System.DBNull))  
				model.Value2 = ( string)dr["value2"];
			
			return model;
		}
    }
}
